package cn.tedu.submarine;

import javax.swing.ImageIcon;


public class Battleship extends SeaObject {
    private int life;

    // 构造方法
    public Battleship() {
        super(66, 26, 500, 124, 20);
        life = 5;
    }


    public void move(){

    }


    public ImageIcon getImage() {
        return Images.battleship;

    }

    public Bomb shoot() {
        return new Bomb(this.x, this.y);//深水炸弹的坐标就是战舰的目标
    }

    public void moveLeft() {
        x -= speed;
    }

    public void moveRight() {
        x += speed;
    }

    public void addLife(int num){
        life+=num;
    }

    public int getLife(){
        return life;
    }

    public void subtractLife(){
        life--;
    }
}



